package cn.itcast.wanxinp2p.consumer.agent.fegin;


import cn.itcast.wanxinp2p.common.domain.RestResponse;
import cn.itcast.wanxinp2p.dto.account.AccountDTO;
import cn.itcast.wanxinp2p.dto.account.AccountRegisterDTO;
import io.swagger.annotations.ApiOperation;
import org.dromara.hmily.annotation.Hmily;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 建立fegin的远程调用
 * @author 一方通行
 */
@FeignClient("account-service")
@RequestMapping("/account")
public interface AccountApiAgent {

    /**
     * 统一账号服务实现保存功能
     * @param accountRegisterDTO 客户端用户传输的基础数据
     * @return 返回用户数据
     */
    @PostMapping(value = "/l/accounts")
    @Hmily
    public RestResponse<AccountDTO> register(@RequestBody AccountRegisterDTO accountRegisterDTO);

    /**
     * 测试
     */
    @GetMapping("/helloWord")
    public String helloWord();

}
